package everyday.nowcoder;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @Author: wenjingyuan
 * @Date: 2022/11/18/21:42
 * @Description:组队竞赛
 * https://www.nowcoder.com/questionTerminal/6736cc3ffd1444a4a0057dee89be789b?orderByHotValue=1&page=1&onlyReference=false
 */
public class Num10049 {
    public static void main(String[] args){
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNext()){
            int n=scanner.nextInt();
            int[] arr=new int[3*n];
            for (int i = 0; i < 3*n; i++) {
                arr[i]=scanner.nextInt();
            }
            Arrays.sort(arr);
            long sum=0;
            for(int i=3*n-2;i>=n;i=i-2){
                sum+=arr[i];
            }
            System.out.println(sum);
        }
    }
}
